Before using any other Window Manager functions, you must initialize the Window Manager by calling the InitWindows function (InitWindows) .
As part of initialization, InitWindows creates the Window Manager port, a graphics port that occupies all of the main screen. The Window Manager port is named WMgrCPort on Macintosh computers equipped with Color QuickDraw and WMgrPort on computers with only QuickDraw.
Ordinarily, your application does not need to know about the Window Manager port. If necessary, however, you can retrieve a pointer to it by calling the function GetWMgrPort (GetWMgrPort) or GetCWMgrPort (GetCWMgrPort) . Your application should not draw directly into the Window Manager port, except through custom window definition functions.
The Window Manager draws your application's windows into the Window Manager port. The port rectangle of the Window Manager port is the bounding rectangle of the main screen ( screenBits.bounds ). To accommodate systems with multiple monitors, QuickDraw recognizes a port rectangle of screenBits.bounds as a special case and allows drawing on all parts of the desktop.
Initializes the Window Manager for your application.
pascal void InitWindows(void);
Before calling InitWindows , you must initialize QuickDraw and the Font Manager by calling the InitGraf and InitFonts routines, documented in Inside Macintosh: Imaging and Inside Macintosh: Text .
When the desktop needs to be redrawn any time after initialization, the Window Manager checks the global variable DeskHook , which can be used as a pointer to an application-defined function for drawing the desktop . This variable is ordinarily set to 0, but not until after system startup. If you're displaying windows in code that is to be executed during startup, set DeskHook to 0. Note that the use of the Window Manager's global variables is not guaranteed to be compatible in system software versions later than System 6.